const router = require('koa-router')({
  prefix: '/api'
})

const controllers = require('../controllers')

//登录
router.post('/user/login', controllers.user.login)
// 验证token
router.post('/user/verify_token', controllers.user.verifyToken)
//获取验证码
router.get('/user/captcha', controllers.user.captcha)
// 添加用户
router.post('/user/add_user', controllers.user.addUser)
// 获取用户详情
router.post('/user/detail_info', controllers.user.detailInfo)
// 更新用户信息
router.post('/user/update_info', controllers.user.updateInfo)
// 修改密码
router.post('/user/update_password', controllers.user.updatePassword)
// 删除用户
router.post('/user/delete_user', controllers.user.deleteUser)
// 获取用户信息
router.get('/user/user_info', controllers.user.userInfo)
// 获取用户列表
router.post('/user/all_user', controllers.user.allUser)
// 修改头像
router.post('/user/update_avatar', controllers.user.avatar)


// 修改二维码
router.post('/goods/upload', controllers.goods.upload)
// 修改系统配置
router.post('/goods/setInfo', controllers.goods.info.setInfo)
router.get('/goods/getInfo', controllers.goods.info.getInfo)

// 添加模板
router.post('/goods/add_template', controllers.goods.template.add_template)
router.post('/goods/validate_name', controllers.goods.template.validate_name)
router.post('/goods/search_template', controllers.goods.template.search_template)
router.post('/goods/get_template', controllers.goods.template.get_template)

router.get('/goods/get_template_name', controllers.goods.goods.get_template_name)
router.post('/goods/get_dispensable_parameter', controllers.goods.goods.get_dispensable_parameter)
router.post('/goods/add_goods', controllers.goods.goods.add_goods)
router.post('/goods/updata_goods', controllers.goods.goods.updata_goods)
router.post('/goods/get_goods', controllers.goods.goods.get_goods)
router.post('/goods/goods_sold', controllers.goods.goods.goods_sold)
router.post('/goods/get_goods_parameter', controllers.goods.goods.get_goods_parameter)
router.post('/goods/validate_serial_number', controllers.goods.goods.validate_serial_number)

router.post('/goods/return_superior', controllers.goods.returnedGoods.return_superior)
router.post('/goods/return_sale', controllers.goods.returnedGoods.return_sale)

router.post('/goods/goods_qurty', controllers.goods.query.goods_qurty)



//----------------------------------------
//获取域名
router.get('/setting/domain',  controllers.mock.domain)
// 获取未读消息列表
router.get('/msg/unread',  controllers.mock.unreadMsg)
// 获取短信验证码
router.post('/captcha/sms',  controllers.mock.captchaCode)
// 获取首页信息
router.get('/index',  controllers.mock.home)
// 获取行情
router.get('/market',  controllers.mock.market)
// 获取审核信息
router.get('/settlement',  controllers.mock.audit)
// 获取贷款信息
router.get('/loan',  controllers.mock.loan)
// 获取保险
router.get('/insure',  controllers.mock.insure)
// 获取用户数据
router.get('/user',  controllers.mock.userInfo)
// 获取支付列表
router.get('/recharge/channel',  controllers.mock.recharge)
// 获取提现费率
router.get('/setting/withdrawal/rate',  controllers.mock.withdrawalRate)
// 获取银行地址
router.get('/bank',  controllers.mock.bank)
//----------------------------------------








module.exports = router